<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("admin.member.list")}</title>
<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css" >
	.ava{
		width:40px;
		height: 40px;
        cursor: pointer;
	}
	.search-ele{
		border: 1px solid #c8c8c8;
		width: auto;
        float: left;
		padding: 4px;
		margin: 0 3px 5px 0;
	}
	.search-ele span{
        float: left;
		padding: 0px 5px;
		color: #909090;
	}
	.search-ele .in{
		border: 0px;
		border-left: 1px solid #c8c8c8;
        float: left;
		width: 90px;
		padding: 1px 5px;
	}
    .search-ele select{
		padding: 1px;
		border: 0;
		margin-top: -1px;
	}
    #filter{
		background: #2094ee;
		color: #ffffff;
		padding: 6px 10px;
		border: 0;
		border-radius: 2px;
	}
</style>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">首页</a> &raquo; 会员列表 <span>(${message("admin.page.total", page.total)})</span>
	</div>
	<form id="listForm" action="list.htm" method="get">
		<div class="bar">
			<a href="add.htm" class="iconButton" id="addButton">
				<i class="iconfont icon-anonymous-iconfont1">&nbsp;</i>${message("admin.common.add")}
			</a>
			<div class="buttonWrap">
				<a href="javascript:" id="deleteButton" class="iconButton disabled">
					<i class="iconfont icon-icon27">&nbsp;</i>${message("admin.common.delete")}
				</a>
				<a href="javascript:" id="refreshButton" class="iconButton">
					<i class="iconfont icon-shuaxin1">&nbsp;</i>${message("admin.common.refresh")}
				</a>
				<div class="menuWrap">
					<a href="javascript:" id="pageSizeSelect" class="button">
						${message("admin.page.pageSize")}<span class="arrow">&nbsp;</span>
					</a>
					<div class="popupMenu">
						<ul id="pageSizeOption">
							<li>
								<a href="javascript:"[#if page.pageSize == 10] class="current"[/#if] val="10">10</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 20] class="current"[/#if] val="20">20</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 50] class="current"[/#if] val="50">50</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 100] class="current"[/#if] val="100">100</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="menuWrap">
				<div class="search-ele"><span>用户名</span><input placeholder="输入关键词" class="in" type="text" name="username" value="${username}" /></div>
                <div class="search-ele"><span>姓名</span><input placeholder="输入关键词" class="in" type="text" name="name" value="${name}" /></div>
                <div class="search-ele"><span>角色</span>
					<select name="juese">
                        <option value="">不选择</option>
						<option value="member"[#if juese=="member"] selected[/#if]>会员</option>
                        <option value="teacher"[#if juese=="teacher"] selected[/#if]>老师</option>
					</select>
				</div>
            	<div class="search-ele"><span>性别</span>
                    <select name="gender">
                        <option value="">不选择</option>
                        <option value="male" [#if gender=="male"] selected[/#if]>男</option>
                        <option value="female" [#if gender=="female"] selected[/#if]>女</option>
                    </select>
        		</div>
                <div class="search-ele"><span>注册时间</span>
				<input placeholder="开始时间" class="in" type="text" name="startCreateDate" value="[#if startCreateDate??]${startCreateDate?string("yyyy-MM-dd")}[/#if]"  onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'});" />
                <input placeholder="结束时间" class="in" type="text" name="endCreateDate" value="[#if endCreateDate??]${endCreateDate?string("yyyy-MM-dd")}[/#if]"  onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd'});" />
				</div>
                <button id="filter" type="submit">筛 选</button>
       		</div>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check">
					<input type="checkbox" id="selectAll" />
				</th>
                <th>
                    <a href="javascript:">头像</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="category.name">分类</a>
                </th>
                <th>
					<a href="javascript:" class="sort" id="username" name="username">${message("Member.username")}</a>
				</th>
                <th>
                    <a href="javascript:" class="sort" name="name">姓名</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="tags">标签</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="balance">余额</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="earnings">收入</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="point">积分</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="isTop">是否置顶</a>
                </th>
                <th>
					<span>案例</span>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="type">用户状态</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="memberCertification.status">申请</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="introduction">简介</a>
                </th>
				<th>
					<a href="javascript:" class="sort" name="createDate">${message("admin.common.createDate")}</a>
				</th>
				<th>
					<span>${message("admin.member.status")}</span>
				</th>
				<th>
					<span>${message("admin.common.handle")}</span>
				</th>
			</tr>
			[#list page.content as member]
                <tr id="${member.id}">
                    <td>
						<input type="checkbox" name="ids" value="${member.id}" />
					</td>
                    <td>
                        <img src="${(member.avator)!"/resources/admin/images/avator.png"}" class="ava am-circle" />
                    </td>
                    <td>
						${(member.category.name)!"-"}
                    </td>
                    <td>
						${member.username}
					</td>
                    <td>
						${(member.name)!""}
                    </td>
                    <td>
						[#if member.tags??]
							[#list member.tags?split('!!') as tag]
								<span class="am-badge am-badge-success am-radius">${tag}</span>
							[/#list]
						[/#if]
                    </td>
                    <td>
						${(member.balance)!"0"} 元
                    </td>
                    <td>
						${(member.earnings)!"0"} 元
                    </td>
                    <td>
						${(member.point)!"0"}
                    </td>
                    <td>
						[#if member.isTop == "true"]
                            是
						[#else ]
                            否
						[/#if]
                    </td>
                    <td>
						${(member.cases?size)!"0"}
                    </td>
                    <td>
                        <span [#if member.type == "teacher"]class="am-badge am-badge-danger am-radius"[#else] class="am-badge am-badge-warning am-radius"[/#if]>${(member.type.toValue())!"普通用户"}</span>
                    </td>
                    <td>
						[#if member.memberCertification]
							<span [#if member.memberCertification.status == "reviewing"]class="am-badge am-badge-warning am-radius"[#elseif member.memberCertification.status == "passed"]class="am-badge am-badge-success am-radius"[#else ]class="am-badge am-badge-danger am-radius"[/#if]>${(member.memberCertification.status.toValue())!"审核中"}</span>
						[/#if]
                    </td>
                    <td>
						${abbreviate(member.introduction, 20, "...")}
                    </td>
					<td>
						<span title="${member.createDate?string("yyyy-MM-dd HH:mm:ss")}">${member.createDate?string("yyyy-MM-dd HH:mm:ss")}</span>
					</td>
					<td>
						[#if !member.isEnabled]
							<span class="red">${message("admin.member.disabled")}</span>
						[#elseif member.isLocked]
							<span class="red"> ${message("admin.member.locked")} </span>
						[#else]
							<span class="green">${message("admin.member.normal")}</span>
						[/#if]
					</td>
					<td>
						<a href="edit.htm?id=${member.id}"><i class="iconfont icon-bianji edit-icon" ></i></a>
					</td>
				</tr>
			[/#list]
		</table>
		[@pagination pageNumber = page.pageNumber totalPages = page.totalPages]
			[#include "/admin/include/pagination.ftl"]
		[/@pagination]
	</form>
</body>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/amazeui.min.js"></script>
<script type="text/javascript" src="${base}/resources/admin/datePicker/WdatePicker.js"></script>
<script type="text/javascript">
    $().ready(function() {

        $(".ava").on("click", function() {
		    window.open($(this).attr("src"));
		})

	[@flash_message /]

	$("#listTable tr").dblclick(function() {
		if($(this).index() != 0) {
			location.href = "/asl-admin/member/edit.action?id="+$(this).attr("id");
		}
	})

    });
</script>
</html>